%{
#include <stdlib.h>
#include <cstring>
void yyerror(char*);
#include"ReadProg.tab.h"
%}
letter   [A-Za-z]
digit    [0-9]
ID       ({letter})({letter}|{digit}|"_")*
STRING [_a-zA-z0-9][_a-zA-z0-9\.]*
%%
[0-9]+                 {   /*printf("%s\n", yytext);*/ yylval.vblno = atoi(yytext);
                           return(INTEGER);
                       }
"-"                    { return(MINUS);
                       }
"+"                    { return(PLUS);
                       }
"*"                    { return(MULTI); 
                       }
"/"                    { return(DIVID);
                       }
"<"                    { return(LL); 
                       }
">"                    { return(GL);
                       }
"~"                    { return(NOT);
                       }
"&"                    { return(AND);
                       }
"|"                    { return(OR);
                       }
"\n"                   ;//{ return(EOLINE); }
";"                    ;//{ return(EOLINE); }
" "                    ;//{ return(EOLINE); }
"("                    { return(LPART); }
")"                    { return(RPART); }
"["                    { return(LMPART); }
"]"                    { return(RMPART); }
"{"                    { return(LBPART); }
"}"                    { return(RBPART); }
"."                    { return(DOT); }
","		       { return(COMMA); } 
":"		       { return(COLON); }
"="                    { return(ASSIGN); }
"!="                   { return(NONEQUAL); }
"=="                   { return(EQUAL); /*printf("EQUAL");*/ }
"true"                 { yylval.btype = true;
                         return(TRUE); }
"false"                { yylval.btype = false;
                         return(FALSE); }
"if"                   { return(IF); }
"then"                 { return(THEN); }
"else"                 { return(ELSE); }
"skip"                 { return(SKIP); }
"while"                { return(WHILE); }
"assert"               { return(ASSERT); }
"call"                 { return(CALL); }
"goto"		       { return(GOTO); }
"continue"             { return(CONTINUE); }
"break"		       { return(BREAK); }
"return"               { return(RETURN); }
{ID}                   { /*printf("%s\n", yytext);*/strcpy(yylval.str, (char*)yytext); return STRING; }
%%

int yywrap(){
    return 1;
}
